﻿@model DesignerData
@{
    Layout = null;
    ViewBag.Title = "עיצוב אלבום";
    var user = Keepo.Helpers.UserHelper.CurrentUser();
    if (Model.DesignerAction == "Preview")
    {
        ViewBag.Title = "תצוגה מקדימה";
    }
}
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Helpers.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Designer.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/JqueryUIfixes.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.6.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Site.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/PublicLayout.js")" type="text/javascript"></script>

    <!-- Load script and stylesheet Files of plupload -->
    <script src="@Url.Content("~/swfobject.js")" type="text/javascript"></script>
    <script type="text/javascript">
        var xiSwfUrlStr = "swf/playerProductInstall.swf";
        var flashvars = {};
        
        flashvars.albumId = @(Model.AlbumId != null ? Model.AlbumId : -1);
        flashvars.albumSectionId =@(Model.AlbumSectionId != null ? Model.AlbumSectionId : -1);
        flashvars.premadePageId =@(Model.PremadePageId != null ? Model.PremadePageId : -1);
        flashvars.designerAction = "@Model.DesignerAction";
        flashvars.returnUrl = "@Model.ReturnUrl";
        
        flashvars.serverUrl = "@Keepo.Helpers.StringHelper.SiteURL(Url)";

        var params = {};
        params.wmode = "transparent";
        var swfVersionStr = "10.2.0";

        
        designerVersion = @(Model.DesignerVersion);
        
        switch(designerVersion)
        {
            case 1:
            var so = swfobject.embedSWF("swf/AlbumDesigner.swf?time="+Math.random(), "myContent", "100%", "99%", swfVersionStr, xiSwfUrlStr, flashvars, params);
            break;

            case 2:
            var so = swfobject.embedSWF("swf2/AlbumDesigner.swf?time="+Math.random(), "myContent", "100%", "99%", swfVersionStr, xiSwfUrlStr, flashvars, params);
            break;
        }
        
    </script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/Designer.js")"></script>
</head>
<body>
    <div class="designerPage">
        <div id="myContent">
            <div id="myAlternativeContent">
                <h1>
                    Alternative content</h1>
                <p>
                    <a href="http://www.adobe.com/go/getflashplayer">
                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
                            alt="Get Adobe Flash player" /></a></p>
            </div>
        </div>
        <div id="divMainDialog">
        </div>
        <form id="frmUploadImage" action="">
        <div id="uploader" class="clear">
            <p>
                You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.
            </p>
        </div>
        @Html.Hidden("albumId", (object)Model.AlbumId)
        @Html.Hidden("albumSectionId", (object)Model.AlbumSectionId)
        </form>
        <script type="text/javascript">
            //save the prefix that should be on the URL paths (according to the root of the application) - to support developer and production enviornment
            var pathPrefix = '@Url.Action("Index", "Home")';
        </script>
    </div>
</body>
</html>
